Repository navigation
Surface dataset withdrawal in the CLI - #1134
Merged
Merged
Conversation
This was referenced Aug 23, 2026
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
nemar dataset status on008014printedStatus: active, a live DOI link, and a download hint, with nothing saying the dataset had been withdrawn. It also printedData: incomplete (some files failed to upload; see \nemar admin data-integrity-sweep`)` -- pointing an operator at an integrity sweep for content that was removed on purpose.That combination is not a cosmetic gap: it is what made a withdrawal cohort look like a data-loss incident and sent #1048 off after the wrong defect. Every surface described these datasets as broken rather than as gone.
Closes #1048.
Why
statuscould not just say "withdrawn"statusis the lifecycle column (active/archived/deleted) and withdrawal is a separate axis recorded inwithdrawn_at/withdrawn_reason(migration 0060). A withdrawn dataset is legitimately stillactive. So the fix is to print the second axis, not to overload the first.No backend change was needed for the dataset half:
GET /datasets/:idselectsd.*, so both columns were already in the response and simply never rendered. Visibility rules are untouched -- an anonymous caller still gets 404 for these, as before.What changed
nemar dataset status, whenwithdrawn_atis set:Withdrawn:line directly underStatus:, with the reason, because that is the line a reader takes their answer from(tombstoned), since it resolves to a registrar tombstone rather than the datasetData:readsremoved as part of the withdrawalinstead of sending the reader to the integrity sweepnemar admin import statusgains awithdrawn Nline.GET /admin/importsnow returns that count, computed by joiningdatasets.withdrawn_at. It is reported alongsideby_status, not inside it: a withdrawn dataset's import genuinely completed and itsimport_jobsrow is correctlycomplete, so moving the count would misreport the import lifecycle. The CLI line says so explicitly (included in complete). The field is optional client-side, so an older backend just omits the line.Test plan
Five real-D1 tests (
backend/test/imports-withdrawn-count.test.ts, no mocks): onlywithdrawn_atrows count; withdrawn rows stay insideby_status.complete; zero when nothing is withdrawn; the count stays fleet-wide under a?status=filter; and a withdrawn dataset with no import job is excluded.Verified end to end against the live API rather than only in tests:
The
Data:line above is the one the first pass of this change got wrong -- it still readincomplete ... see nemar admin data-integrity-sweepuntil running it against real data showed it. Also confirmedadmin import statusdegrades cleanly against production, which does not yet returnwithdrawn: the line is simply absent.tsc --noEmit(both projects) andbiome checkclean.